/*
 Navicat Premium Data Transfer

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 50720
 Source Host           : localhost
 Source Database       : api

 Target Server Type    : MySQL
 Target Server Version : 50720
 File Encoding         : utf-8

 Date: 08/10/2018 14:21:33 PM
*/

SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
--  Table structure for `classify`
-- ----------------------------
DROP TABLE IF EXISTS `classify`;
CREATE TABLE `classify` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `classify_name` varchar(20) NOT NULL,
  `userl_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `userl_id` (`userl_id`),
  CONSTRAINT `classify_ibfk_1` FOREIGN KEY (`userl_id`) REFERENCES `userl` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `classify`
-- ----------------------------
BEGIN;
INSERT INTO `classify` VALUES ('1', 'python', '1'), ('2', 'python', '2');
COMMIT;

-- ----------------------------
--  Table structure for `comment`
-- ----------------------------
DROP TABLE IF EXISTS `comment`;
CREATE TABLE `comment` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `author` text,
  `content` varchar(32) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `comment`
-- ----------------------------
BEGIN;
INSERT INTO `comment` VALUES ('1', '哈哈', 'asdasd'), ('2', '哈哈', '哈哈'), ('3', '哈哈', '哈哈'), ('4', '哈哈', '哈哈'), ('5', '哈哈', '哈哈'), ('6', '哈哈', '哈哈'), ('7', '哈哈', '哈哈'), ('8', '2', '2');
COMMIT;

-- ----------------------------
--  Table structure for `content`
-- ----------------------------
DROP TABLE IF EXISTS `content`;
CREATE TABLE `content` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `content_title` varchar(20) NOT NULL,
  `content_content` varchar(10000) NOT NULL,
  `classify_id` int(11) DEFAULT NULL,
  `userl_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `classify_id` (`classify_id`),
  KEY `userl_id` (`userl_id`),
  CONSTRAINT `content_ibfk_1` FOREIGN KEY (`classify_id`) REFERENCES `classify` (`id`) ON DELETE CASCADE,
  CONSTRAINT `content_ibfk_2` FOREIGN KEY (`userl_id`) REFERENCES `userl` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `content`
-- ----------------------------
BEGIN;
INSERT INTO `content` VALUES ('1', '哈哈', '<p>哈哈哈</p>\r\n\r\n<div style=\"z-index: 100000000; position: fixed; top: 0px; left: 0px; width: 120px; height: 120px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-size: contain; display: none; background-position: center bottom; background-repeat: no-repeat no-repeat;\">&nbsp;</div>\r\n', '1', '1');
COMMIT;

-- ----------------------------
--  Table structure for `user`
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(32) DEFAULT NULL,
  `password` varchar(32) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `user`
-- ----------------------------
BEGIN;
INSERT INTO `user` VALUES ('1', 'clay1', 'asd'), ('2', 'blue', 'asdwads'), ('3', 'dfsf', 'sadwa'), ('7', 'asdasd', 'dfsd');
COMMIT;

-- ----------------------------
--  Table structure for `userl`
-- ----------------------------
DROP TABLE IF EXISTS `userl`;
CREATE TABLE `userl` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `userl_name` varchar(20) NOT NULL,
  `userl_password` varchar(20) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `userl`
-- ----------------------------
BEGIN;
INSERT INTO `userl` VALUES ('1', 'clay', 'asdwasdw'), ('2', 'clay1', 'asdwasdw'), ('3', 'admin', 'admin');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
